import { createRouter, createWebHistory } from "vue-router";
//创建管理路由
export default createRouter({
    //路由设置模式
    history: createWebHistory(),
    //管理路由
    routes: [
        {
            path: '/home',
            component: () => import('@/pages/home/index.vue'),
            meta: {
                title: '首页'
            }
        }, {
            path: '/hospital',
            component: () => import('@/pages/hospital/index.vue'),
            children: [{
                path: 'register',
                component: () => import('@/pages/hospital/register/index.vue'),
                meta: {
                    title: '预约挂号'
                }
            },
            {
                path: 'detail',
                component: () => import('@/pages/hospital/detail/index.vue'),
                meta: {
                    title: '挂号详情'
                }
            },
            {
                path: 'close',
                component: () => import('@/pages/hospital/close/index.vue')
            },
            {
                path: 'search',
                component: () => import('@/pages/hospital/search/index.vue'),
                meta: {
                    title: '查询'
                }
            },
            {
                path: 'notice',
                component: () => import('@/pages/hospital/notice/index.vue')
            },
            {
                path: 'register_step1',
                component: () => import('@/pages/hospital/register/register_step1.vue')
            },
            {
                path: 'register_step2',
                component: () => import('@/pages/hospital/register/register_step2.vue')
            }]
        }, {
            path: '/',
            redirect: '/home'
        }, {
            path: '/wxlogin',
            component: () => import('@/pages/wxlogin/index.vue')
        }, {
            path: '/user',
            component: () => import('@/pages/user/index.vue'),
            children: [
                {
                    path: 'menber',
                    component: () => import('@/pages/user/menber/index.vue')
                },
                {
                    path: 'order',
                    //@ts-ignore
                    component: () => import('@/pages/user/order/index.vue'),
                    meta: {
                        title: '订单'
                    }
                },
                {
                    path: 'feedback',
                    component: () => import('@/pages/user/feedback/index.vue'),
                    meta: {
                        title: '反馈'
                    }
                },
                {
                    path: 'profile',
                    component: () => import('@/pages/user/profile/index.vue')
                }, {
                    path: 'patient',
                    component: () => import('@/pages/user/patient/index.vue')
                }]
        }
    ],
    scrollBehavior() {
        return {
            left: 0,
            top: 0
        }
    }


})